<?php
/**
{
    "orderId": "INT // 订单id@search",
    "orderType": "TINYINT //订单类型@status; 1::课程; 2::打赏; 3::续费; @search; ",
    "schoolId": "INT //机构@foreign::tbl_school; @search; ",
    "teacherId": "INT //打赏老师@foreign::tbl_teacher; @noLoad; @search; @noList; ",
    "buyerUid": "INT //买家用户Id@foreign::tbl_user",
    "title": "TINYTEXT //购买的内容@search; ",
    "location": "VARCHAR //地址@noList; ",
    "courseLogoUrl": "VARCHAR //课程图片@noList; ",
    "courseStart": "VARCHAR //上课开始时间@noList; ",
    "courseEnd": "VARCHAR //上课结束时间@noList; ",
    "mobile": "VARCHAR //手机号@noList",
    "goodsPrice": "DECIMAL //原价@noload",
    "goodsCount": "INT //数量",
    "unitPrice": "DECIMAL //单价",
    "buyerShouldPay": "DECIMAL //买家应该支付@noload",
    "buyerPay": "DECIMAL //买家已支付（元）@noload",
    "promotionUid": "INT //用了哪个用户的邀请码@noList",
    "promotionId": "INT //优惠券@foreign::tbl_promotion; @noload",
    "promotion": "DECIMAL //优惠（元）@noload; @noList; ",
    "useGold": "TINYINT //使用金币@status; 0::不使用; 1::使用; ",
    "useScore": "TINYINT //使用积分@status; 0::不使用; 1::使用; ",
    "gold": "INT //使用金币数@noLoad; ",
    "score": "INT //使用积分数@noLoad; ",
    "status": "TINYINT //状态@status; 0::待付款; 1::已支付; 2::已评价; 7::订单已过期; 9::已退款; @search; ",
    "payTime": "DATETIME //支付时间@noload",
    "buyerTradeNo": "VARCHAR //买家交易号@noload; @noList",
    "ip": "VARCHAR //ip@noload; @hide; @noList; ",
    "created": "DATETIME //创建时间",
    "courseId": "INT //课程@foreign::tbl_course; @noList; @search; "
}
 */

class Order extends Base
{
    
	public $orderId= '';// 订单id@search
	public $orderType= "1";//订单类型@status;1::课程;2::打赏;3::续费;@search;
	public $schoolId= "0";//机构@foreign::tbl_school;@search;
	public $teacherId= "0";//打赏老师@foreign::tbl_teacher;@noLoad;@search;@noList;
	public $buyerUid= '';//买家用户Id@foreign::tbl_user
	public $title= '';//购买的内容@search;
	public $location= NULL;//地址@noList;
	public $courseLogoUrl= NULL;//课程图片@noList;
	public $courseStart= NULL;//上课开始时间@noList;
	public $courseEnd= NULL;//上课结束时间@noList;
	public $mobile= NULL;//手机号@noList
	public $goodsPrice= "0.00";//原价@noload
	public $goodsCount= "1";//数量
	public $unitPrice= "0.00";//单价
	public $buyerShouldPay= NULL;//买家应该支付@noload
	public $buyerPay= "0.00";//买家已支付（元）@noload
	public $promotionUid= "0";//用了哪个用户的邀请码@noList
	public $promotionId= "0";//优惠券@foreign::tbl_promotion;@noload
	public $promotion= "0.00";//优惠（元）@noload;@noList;
	public $useGold= "0";//使用金币@status;0::不使用;1::使用;
	public $useScore= "0";//使用积分@status;0::不使用;1::使用;
	public $gold= "0";//使用金币数@noLoad;
	public $score= "0";//使用积分数@noLoad;
	public $status= "0";//状态@status;0::待付款;1::已支付;2::已评价;7::订单已过期;9::已退款;@search;
	public $payTime= NULL;//支付时间@noload
	public $buyerTradeNo= NULL;//买家交易号@noload;@noList
	public $ip= NULL;//ip@noload;@hide;@noList;
	public $created= 'CURRENT_TIMESTAMP';//创建时间
	public $courseId= '';//课程@foreign::tbl_course;@noList;@search;

    public $isDbData = false;

    public function __construct()
    {
        parent::__construct();
    }


    public function __get($name) {
        return $this->$name;
    }

    public function __set($name, $value) {
        if(!$this->isDbData){
            if(!in_array($name,$this->loadedFiled))$this->loadedFiled[] = $name;
        }

        $this->$name=$value;
        $this->arr[$name] = $value;
    }

    public  function table()
    {
        return 'tbl_order';
    }
    
    public  function key(){
        return 'orderId';
    }


    
    public static  function hideField()
    {
        return array (  0 => 'ip',);
    }
            
    public static  function skipField()
    {
        return [];
    }
            
    public static  function noViewField()
    {
        return [];
    }
            
    public static  function jsonField()
    {
        return [];
    }
            
    public static  function noLoadField()
    {
        return array (  0 => 'teacherId',  1 => 'gold',  2 => 'score',);
    }
            
    public static  function deleteField()
    {
        return [];
    }
            
    public function className()
    {
        return 'Order';
    }
    
    public  function field()
    {
        return array (  'orderId' =>   array (    0 => 'INT',    1 => 10,    2 => ' 订单id@search',  ),  'orderType' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '订单类型@status;1::课程;2::打赏;3::续费;@search;',  ),  'schoolId' =>   array (    0 => 'INT',    1 => 11,    2 => '机构@foreign::tbl_school;@search;',  ),  'teacherId' =>   array (    0 => 'INT',    1 => 11,    2 => '打赏老师@foreign::tbl_teacher;@noLoad;@search;@noList;',  ),  'buyerUid' =>   array (    0 => 'INT',    1 => 11,    2 => '买家用户Id@foreign::tbl_user',  ),  'title' =>   array (    0 => 'TINYTEXT',    1 => 0,    2 => '购买的内容@search;',  ),  'location' =>   array (    0 => 'VARCHAR',    1 => 512,    2 => '地址@noList;',  ),  'courseLogoUrl' =>   array (    0 => 'VARCHAR',    1 => 512,    2 => '课程图片@noList;',  ),  'courseStart' =>   array (    0 => 'VARCHAR',    1 => 20,    2 => '上课开始时间@noList;',  ),  'courseEnd' =>   array (    0 => 'VARCHAR',    1 => 20,    2 => '上课结束时间@noList;',  ),  'mobile' =>   array (    0 => 'VARCHAR',    1 => 30,    2 => '手机号@noList',  ),  'goodsPrice' =>   array (    0 => 'DECIMAL',    1 => 16,    2 => '原价@noload',  ),  'goodsCount' =>   array (    0 => 'INT',    1 => 11,    2 => '数量',  ),  'unitPrice' =>   array (    0 => 'DECIMAL',    1 => 15,    2 => '单价',  ),  'buyerShouldPay' =>   array (    0 => 'DECIMAL',    1 => 15,    2 => '买家应该支付@noload',  ),  'buyerPay' =>   array (    0 => 'DECIMAL',    1 => 15,    2 => '买家已支付（元）@noload',  ),  'promotionUid' =>   array (    0 => 'INT',    1 => 11,    2 => '用了哪个用户的邀请码@noList',  ),  'promotionId' =>   array (    0 => 'INT',    1 => 11,    2 => '优惠券@foreign::tbl_promotion;@noload',  ),  'promotion' =>   array (    0 => 'DECIMAL',    1 => 15,    2 => '优惠（元）@noload;@noList;',  ),  'useGold' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '使用金币@status;0::不使用;1::使用;',  ),  'useScore' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '使用积分@status;0::不使用;1::使用;',  ),  'gold' =>   array (    0 => 'INT',    1 => 11,    2 => '使用金币数@noLoad;',  ),  'score' =>   array (    0 => 'INT',    1 => 11,    2 => '使用积分数@noLoad;',  ),  'status' =>   array (    0 => 'TINYINT',    1 => 4,    2 => '状态@status;0::待付款;1::已支付;2::已评价;7::订单已过期;9::已退款;@search;',  ),  'payTime' =>   array (    0 => 'DATETIME',    1 => 0,    2 => '支付时间@noload',  ),  'buyerTradeNo' =>   array (    0 => 'VARCHAR',    1 => 50,    2 => '买家交易号@noload;@noList',  ),  'ip' =>   array (    0 => 'VARCHAR',    1 => 15,    2 => 'ip@noload;@hide;@noList;',  ),  'created' =>   array (    0 => 'DATETIME',    1 => 0,    2 => '创建时间',  ),  'courseId' =>   array (    0 => 'INT',    1 => 11,    2 => '课程@foreign::tbl_course;@noList;@search;',  ),);
    }


}